package com.kystar.muxplayer.protocol.code.get;

import com.kystar.muxplayer.protocol.CodeCmd;
import java.io.IOException;

public class CG82_ConcatMode extends CodeCmd {
    public CG82_ConcatMode() {
        super(CODE_OK);
    }

    @Override
    public byte getCode() {
        return (byte) 0x82;
    }

    public int getConcatMode() throws IOException {
        int row = mResult[0];
        int col = mResult[1];
        switch (row*10 + col){
            case 11: return 0;
            case 14: return 1;
            case 41: return 2;
            case 22: return 3;
            default:
                throw new IOException("bad concat mode" + row + "x"+ col);
        }
    }

    @Override
    public void test() {
        mResult = new byte[]{4,1};
    }

    public static CG82_ConcatMode create() {
        return new CG82_ConcatMode();
    }

}
